from app import db

class User(db.Model):
    __tablename__ = 'users'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    username = db.Column(db.String(32))
    password = db.Column(db.String(32))

class ZhangTpye(db.Model):
    __tablename__ = 'zhangtpye'
    id = db.Column(db.Integer, primary_key=True, auto_increment=True)
    name = db.Column(db.String(32))

class Zhangs(db.Model):
    __tablename__ = 'zhangs'
    id = db.Column(db.Integer, primary_key=True, auto_increment=True)
    name = db.Column(db.String(32))
    url = db.Column(db.String(233))
    zid = db.Column(db.Integer, db.ForeignKey("zhangtpye.id"))

db.create_all()